mount /proc/xen in init.d/xen
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 9 Sep 2009 14:32:30 +0000 (15:32 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 9 Sep 2009 14:32:30 +0000 (15:32 +0100)
pvops dom0 kernels have a separate xenfs which has to be mounted on
/proc/xen.  Systems with older configurations don't have xenfs listed
in fstab, and it can sometimes make sense to keep it that way (for
example, if the dom0 wants to boot a native-only kernel too).

The attached patch to the script which ends up in /etc/init.t/xend
mounts /proc/xen if it appears to be necessary.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/hotplug/Linux/init.d/xend

index 3230f864db8307cdcd34a83168bbb877ed702f43..90c2beabf9d1b32c18a28d001ae0376f342b3747 100755 (executable)
 shopt -s extglob
 test -f /etc/sysconfig/xend && . /etc/sysconfig/xend
 
+if   test "x$1" = xstart && \
+     test -d /proc/xen && \
+   ! test -d /proc/xen/capabilities && \
+     grep '    xenfs$' /proc/filesystems >/dev/null && \
+   ! grep '^xenfs ' /proc/mounts >/dev/null;
+then
+       mount -t xenfs xenfs /proc/xen
+fi
+
 if ! grep -q "control_d" /proc/xen/capabilities ; then
        exit 0
 fi